<template>
	<div class="station-info">
		<p class="chart-title">{{ $t('message.mainStationScreenNews.pageStationInfo') }}</p>
		
		<div class="dashboard">
			<div class="card" v-for="(item, index) in stationInfoData" :key="index">
				<div class="icon">{{ item.icon }}</div>
				<div class="content">
					<div class="value">{{ item.value }}</div>
					<div class="title">
						{{ item.title }}<span class="unit">({{ item.unit }})</span>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script setup>
import { ref } from 'vue';

// 定义props接收父组件数据
const props = defineProps({
	stationInfoData: {
		type: Array,
		default: () => [],
	},
});
</script>

<style lang="scss" scoped>
.station-info {
	border-radius: 0.5rem;
	background-color: #11214e;
	border: 1px solid #5aabfb;
	box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.dashboard {
	display: flex;
	flex-wrap: wrap;
	padding: 0.3rem;
	border-radius: 0.8rem;
	justify-content: space-around;
	background-color: #11214e;
}

.chart-title {
	color: #48a0f8;
	font-size: 1.2rem;
	font-weight: bolder;
	display: inline-flex;
	align-items: center;
	letter-spacing: 2px;
	text-indent: 1rem;
	line-height: 1.8rem;
	padding-top: 0.5rem;
}

.card {
	color: white;
	padding: 0.3rem;
	border-radius: 0.8rem;
	display: flex;
	align-items: center;
	flex: 1 1 22%;
	margin: 0.3rem;
	border: 2px solid rgba(122, 215, 255, 0.3);
}

.icon {
	font-size: 1.5rem;
	margin-right: 0.3rem;
}

.content {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.title {
	font-size: 0.8rem;
	margin-bottom: 0.5rem;
	font-weight: bold;
	text-align: center;
}

.unit {
	color: rgba(255, 255, 255, 0.7);
}

.value {
	font-size: 1rem;
	font-weight: bold;
	text-align: center;
	color: #48a0f8;
}
</style>
